import { typeof2 } from '@/utils/index'

const moduleFiles = import.meta.globEager('./*.js')

const modules = []
Object.keys(moduleFiles).forEach(key => {
  const routes = moduleFiles[key].default

  if (typeof2(routes) === 'array') modules.push(...routes)
  if (typeof2(routes) === 'object') modules.push(routes)
})

export default modules
